FSpOpenDF
FSpOpenDF
Create an access path to the data fork of a file char permission ; permission level
short *refNum ; points to a path reference number
FSpOpenDF creates an access path to the data fork of a file. It is the FSSpec version of the new function HOpenDF, which replaces the functions FSOpen and HOpen. The difference is that HOpenDF opens only the data fork of a file; FSOpen and HOpen can open either a driver or the data fork of a file. Using FSpOpenDF eliminates the ambiguity and ensures that you can open even a file whose name begins with a period (.)
spec is a pointer to an FSSpec record specifying the file to be opened. permission specifies the kind of access path permission you want. In most
cases, you can simply set the permission parameter to fsCurPerm.
See the notes section below for addtional information on the
permission parameter.
refNum is a pointer to the path reference number. FSpOpenDF opens the data fork and places the path reference number in the refNum
parameter.
Returns: an operating system Error Code. It will be one of: noErr (0) No error
bdNamErr (-37) Bad name
extFSErr (-58) External file system
ioErr (-36) I/O error
nsvErr (-35) No such volume
opWrErr (-49) File already open for writing
tmfoErr (-42) Too many files open
Notes: FSpOpenDF takes a permission parameter In most cases, you can simply set the permission parameter to fsCurPerm.
Some applications request fsRdWrPerm, to ensure that they can both read
and write to a file. The constants that can be passed in this field are the
following:
fsCurPerm exclusive read/write permission if it is available;
otherwise, exclusive read, if that is available
fsRdPerm exclusive read permission
fsWrPerm exclusive write permission
fsRdWrPerm exclusive read/write permission
fsRdWrShPerm shared read/write permission
In shared environments, permission requests are translated into the
"deny-mode" permissions defined by AppleShare.